/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.dandsoft.mavrep.web.controller;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.dandsoft.mavrep.web.User;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 *
 * @author fin
 */
@Controller
public class TestController {

    @Autowired
    private BeanFactory factory;

    @RequestMapping(value="/test", method=RequestMethod.GET)
    public void test(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        request.getRequestDispatcher("/test.jsp").forward(request, response);
    }

    @RequestMapping(value="/testTiles", method=RequestMethod.GET)
    public String tiles(User user){
        User s = (User)factory.getBean("user");
        return "test";
    }

    @RequestMapping(value="/testJsp", method=RequestMethod.GET)
    public String jsp(){
        return "admin/test";
    }

}
